import {createStore,applyMiddleware,compose} from 'redux'
import thunk from 'redux-thunk';
import reducer from './reducer'
//查看github  redux-trunk 里面使用方法
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose;

const enhancer = composeEnhancers(
    applyMiddleware(thunk),
  );

//创建store时，用reducer构建初始数据，在创建store时使用一个中渐渐
const store = createStore(reducer, enhancer);


export default store;

